﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using CWQ.Api.Filters;
using OF.Component.Base;


namespace CWQ.Api.Controllers
{
    /// <summary>
    /// 所有ApiController基类 
    /// </summary>
    //[APIAuthorizationFilter]
    [APIActionFilter]
    [APIExceptionFilter]
    public class BaseApiController : ApiController
    {
        /// <summary>
        /// 当前登陆人 
        /// </summary>
        protected string CurrentUser
        {
            get
            {
                return this.ActionContext.RequestContext.Principal.Identity.Name;
            }
        }
        /// <summary>
        /// 根据相对路径地址获取完整的http访问路径
        /// </summary>
        /// <param name="relativePath">相对地址</param>
        /// <returns></returns>
        protected string GetHttpFilePath(string relativePath)
        {
            return AppSettings.GetHttpFilePath(relativePath);
        }
    }
}
